package zezutom.designpatterns.cor;

/**
 * Concrete Request Handler - Cashier  
 * Cashier can approve requests up to 1000$$
 * 
 * @author tomasz
 */
public class Cashier extends GenericHandler {

    public static final String REQUEST_ARRIVED = "\n----\n%d $$ Loan Requested by %s";
        
    public static final int LIMIT = 1000;

    public Cashier() {
        setName("Johny, Cashier");
    }
    
    @Override
    protected int getLimit() {
        return LIMIT;
    }
        
    @Override
    public boolean handleRequest(LoanRequest request) {
        System.out.println(String.format(REQUEST_ARRIVED, request.getAmount(), request.getCustomer()));
        return super.handleRequest(request);
    }
}
